home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / ColorSync 3.0 Mac SDK / Interfaces / CMApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-28  |  52.7 KB  |  1,525 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMApplication.h
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 3.0
  7.                  Release:    ColorSync 3.0 SDK for use with Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992, 1994-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMAPPLICATION__
  18. #define __CMAPPLICATION__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27.  
  28. #ifndef __FILES__
  29. #include <Files.h>
  30. #endif
  31.  
  32. #ifndef __PRINTING__
  33. #include <Printing.h>
  34. #endif
  35.  
  36. #ifndef __CMICCPROFILE__
  37. #include <CMICCProfile.h>
  38. #endif
  39.  
  40. #ifndef __DISPLAYS__
  41. #include <Displays.h>
  42. #endif
  43.  
  44.  
  45.  
  46. #if TARGET_OS_WIN32
  47. #include <windows.h>
  48. #endif
  49.  
  50.  
  51.  
  52. #if PRAGMA_ONCE
  53. #pragma once
  54. #endif
  55.  
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59.  
  60. #if PRAGMA_IMPORT
  61. #pragma import on
  62. #endif
  63.  
  64. #if PRAGMA_STRUCT_ALIGN
  65.     #pragma options align=mac68k
  66. #elif PRAGMA_STRUCT_PACKPUSH
  67.     #pragma pack(push, 2)
  68. #elif PRAGMA_STRUCT_PACK
  69.     #pragma pack(2)
  70. #endif
  71.  
  72. enum {
  73.     kDefaultCMMSignature        = FOUR_CHAR_CODE('appl')
  74. };
  75.  
  76. /* Macintosh 68K trap word */
  77. enum {
  78.     cmTrap                        = 0xABEE
  79. };
  80.  
  81.  
  82. /* PicComment IDs */
  83. enum {
  84.     cmBeginProfile                = 220,
  85.     cmEndProfile                = 221,
  86.     cmEnableMatching            = 222,
  87.     cmDisableMatching            = 223,
  88.     cmComment                    = 224
  89. };
  90.  
  91. /* PicComment selectors for cmComment */
  92. enum {
  93.     cmBeginProfileSel            = 0,
  94.     cmContinueProfileSel        = 1,
  95.     cmEndProfileSel                = 2,
  96.     cmProfileIdentifierSel        = 3
  97. };
  98.  
  99.  
  100. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  101. enum {
  102.     cmMatchCMMType                = 0x00000001,
  103.     cmMatchApplProfileVersion    = 0x00000002,
  104.     cmMatchDataType                = 0x00000004,
  105.     cmMatchDeviceType            = 0x00000008,
  106.     cmMatchDeviceManufacturer    = 0x00000010,
  107.     cmMatchDeviceModel            = 0x00000020,
  108.     cmMatchDeviceAttributes        = 0x00000040,
  109.     cmMatchFlags                = 0x00000080,
  110.     cmMatchOptions                = 0x00000100,
  111.     cmMatchWhite                = 0x00000200,
  112.     cmMatchBlack                = 0x00000400
  113. };
  114.  
  115. /* Defines for version 2.0 CMSearchRecord.searchMask */
  116. enum {
  117.     cmMatchAnyProfile            = 0x00000000,
  118.     cmMatchProfileCMMType        = 0x00000001,
  119.     cmMatchProfileClass            = 0x00000002,
  120.     cmMatchDataColorSpace        = 0x00000004,
  121.     cmMatchProfileConnectionSpace = 0x00000008,
  122.     cmMatchManufacturer            = 0x00000010,
  123.     cmMatchModel                = 0x00000020,
  124.     cmMatchAttributes            = 0x00000040,
  125.     cmMatchProfileFlags            = 0x00000080
  126. };
  127.  
  128. /* Result codes */
  129. enum {
  130.                                                                 /* General Errors */
  131.     cmProfileError                = -170,
  132.     cmMethodError                = -171,
  133.     cmMethodNotFound            = -175,                            /* CMM not present */
  134.     cmProfileNotFound            = -176,                            /* Responder error */
  135.     cmProfilesIdentical            = -177,                            /* Profiles the same */
  136.     cmCantConcatenateError        = -178,                            /* Profile can't be concatenated */
  137.     cmCantXYZ                    = -179,                            /* CMM cant handle XYZ space */
  138.     cmCantDeleteProfile            = -180,                            /* Responder error */
  139.     cmUnsupportedDataType        = -181,                            /* Responder error */
  140.     cmNoCurrentProfile            = -182,                            /* Responder error */
  141.                                                                 /* Profile Access Errors */
  142.     cmElementTagNotFound        = -4200,
  143.     cmIndexRangeErr                = -4201,                        /* Tag index out of range */
  144.     cmCantDeleteElement            = -4202,
  145.     cmFatalProfileErr            = -4203,
  146.     cmInvalidProfile            = -4204,                        /* A Profile must contain a 'cs1 ' tag to be valid */
  147.     cmInvalidProfileLocation    = -4205,                        /* Operation not supported for this profile location */
  148.     cmCantCopyModifiedV1Profile    = -4215,                        /* Illegal to copy version 1 profiles that have been modified */
  149.                                                                 /* Profile Search Errors */
  150.     cmInvalidSearch                = -4206,                        /* Bad Search Handle */
  151.     cmSearchError                = -4207,
  152.     cmErrIncompatibleProfile    = -4208,                        /* Other ColorSync Errors */
  153.     cmInvalidColorSpace            = -4209,                        /* Profile colorspace does not match bitmap type */
  154.     cmInvalidSrcMap                = -4210,                        /* Source pix/bit map was invalid */
  155.     cmInvalidDstMap                = -4211,                        /* Destination pix/bit map was invalid */
  156.     cmNoGDevicesError            = -4212,                        /* Begin/End Matching -- no gdevices available */
  157.     cmInvalidProfileComment        = -4213,                        /* Bad Profile comment during drawpicture */
  158.     cmRangeOverFlow                = -4214,                        /* Color conversion warning that some output color values over/underflowed and were clipped */
  159.     cmNamedColorNotFound        = -4216,                        /* NamedColor not found */
  160.     cmCantGamutCheckError        = -4217                            /* Gammut checking not supported by this ColorWorld */
  161. };
  162.  
  163. /* deviceType values for ColorSync 1.0 Device Profile access */
  164. enum {
  165.     cmSystemDevice                = FOUR_CHAR_CODE('sys '),
  166.     cmGDevice                    = FOUR_CHAR_CODE('gdev')
  167. };
  168.  
  169. /* Commands for CMFlattenUPP(…) */
  170. enum {
  171.     cmOpenReadSpool                = 1,
  172.     cmOpenWriteSpool            = 2,
  173.     cmReadSpool                    = 3,
  174.     cmWriteSpool                = 4,
  175.     cmCloseSpool                = 5
  176. };
  177.  
  178. /* Flags for PostScript-related functions */
  179. enum {
  180.     cmPS7bit                    = 1,
  181.     cmPS8bit                    = 2
  182. };
  183.  
  184. /* Flags for profile embedding functions */
  185. enum {
  186.     cmEmbedWholeProfile            = 0x00000000,
  187.     cmEmbedProfileIdentifier    = 0x00000001
  188. };
  189.  
  190. /* Commands for CMAccessUPP(…) */
  191. enum {
  192.     cmOpenReadAccess            = 1,
  193.     cmOpenWriteAccess            = 2,
  194.     cmReadAccess                = 3,
  195.     cmWriteAccess                = 4,
  196.     cmCloseAccess                = 5,
  197.     cmCreateNewAccess            = 6,
  198.     cmAbortWriteAccess            = 7,
  199.     cmBeginAccess                = 8,
  200.     cmEndAccess                    = 9
  201. };
  202.  
  203.  
  204. /* Abstract data type for memory-based Profile */
  205. typedef struct OpaqueCMProfileRef*         CMProfileRef;
  206. /* Abstract data type for Profile search result */
  207. typedef struct OpaqueCMProfileSearchRef*  CMProfileSearchRef;
  208. /* Abstract data type for BeginMatching(…) reference */
  209. typedef struct OpaqueCMMatchRef*         CMMatchRef;
  210. /* Abstract data type for ColorWorld reference */
  211. typedef struct OpaqueCMWorldRef*         CMWorldRef;
  212. /* Caller-supplied flatten function */
  213. typedef CALLBACK_API( OSErr , CMFlattenProcPtr )(long command, long *size, void *data, void *refCon);
  214. /* Caller-supplied progress function for Bitmap & PixMap matching routines */
  215. typedef CALLBACK_API( Boolean , CMBitmapCallBackProcPtr )(long progress, void *refCon);
  216. /* Caller-supplied progress function for NCMMConcatInit & NCMMNewLinkProfile routines */
  217. typedef CALLBACK_API( Boolean , CMConcatCallBackProcPtr )(long progress, void *refCon);
  218. /* Caller-supplied filter function for Profile search */
  219. typedef CALLBACK_API( Boolean , CMProfileFilterProcPtr )(CMProfileRef prof, void *refCon);
  220. /* Caller-supplied function for profile access */
  221. typedef CALLBACK_API( OSErr , CMProfileAccessProcPtr )(long command, long offset, long *size, void *data, void *refCon);
  222. typedef STACK_UPP_TYPE(CMFlattenProcPtr)                         CMFlattenUPP;
  223. typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr)                 CMBitmapCallBackUPP;
  224. typedef STACK_UPP_TYPE(CMConcatCallBackProcPtr)                 CMConcatCallBackUPP;
  225. typedef STACK_UPP_TYPE(CMProfileFilterProcPtr)                     CMProfileFilterUPP;
  226. typedef STACK_UPP_TYPE(CMProfileAccessProcPtr)                     CMProfileAccessUPP;
  227. #if OPAQUE_UPP_TYPES
  228.     EXTERN_API(CMFlattenUPP)
  229.     NewCMFlattenUPP                   (CMFlattenProcPtr        userRoutine);
  230.  
  231.     EXTERN_API(CMBitmapCallBackUPP)
  232.     NewCMBitmapCallBackUPP           (CMBitmapCallBackProcPtr    userRoutine);
  233.  
  234.     EXTERN_API(CMConcatCallBackUPP)
  235.     NewCMConcatCallBackUPP           (CMConcatCallBackProcPtr    userRoutine);
  236.  
  237.     EXTERN_API(CMProfileFilterUPP)
  238.     NewCMProfileFilterUPP           (CMProfileFilterProcPtr    userRoutine);
  239.  
  240.     EXTERN_API(CMProfileAccessUPP)
  241.     NewCMProfileAccessUPP           (CMProfileAccessProcPtr    userRoutine);
  242.  
  243.     EXTERN_API(void)
  244.     DisposeCMFlattenUPP               (CMFlattenUPP            userUPP);
  245.  
  246.     EXTERN_API(void)
  247.     DisposeCMBitmapCallBackUPP       (CMBitmapCallBackUPP        userUPP);
  248.  
  249.     EXTERN_API(void)
  250.     DisposeCMConcatCallBackUPP       (CMConcatCallBackUPP        userUPP);
  251.  
  252.     EXTERN_API(void)
  253.     DisposeCMProfileFilterUPP       (CMProfileFilterUPP        userUPP);
  254.  
  255.     EXTERN_API(void)
  256.     DisposeCMProfileAccessUPP       (CMProfileAccessUPP        userUPP);
  257.  
  258.     EXTERN_API(OSErr)
  259.     InvokeCMFlattenUPP               (long                    command,
  260.                                     long *                    size,
  261.                                     void *                    data,
  262.                                     void *                    refCon,
  263.                                     CMFlattenUPP            userUPP);
  264.  
  265.     EXTERN_API(Boolean)
  266.     InvokeCMBitmapCallBackUPP       (long                    progress,
  267.                                     void *                    refCon,
  268.                                     CMBitmapCallBackUPP        userUPP);
  269.  
  270.     EXTERN_API(Boolean)
  271.     InvokeCMConcatCallBackUPP       (long                    progress,
  272.                                     void *                    refCon,
  273.                                     CMConcatCallBackUPP        userUPP);
  274.  
  275.     EXTERN_API(Boolean)
  276.     InvokeCMProfileFilterUPP       (CMProfileRef            prof,
  277.                                     void *                    refCon,
  278.                                     CMProfileFilterUPP        userUPP);
  279.  
  280.     EXTERN_API(OSErr)
  281.     InvokeCMProfileAccessUPP       (long                    command,
  282.                                     long                    offset,
  283.                                     long *                    size,
  284.                                     void *                    data,
  285.                                     void *                    refCon,
  286.                                     CMProfileAccessUPP        userUPP);
  287.  
  288. #else
  289.     enum { uppCMFlattenProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  290.     enum { uppCMBitmapCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  291.     enum { uppCMConcatCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  292.     enum { uppCMProfileFilterProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  293.     enum { uppCMProfileAccessProcInfo = 0x0000FFE0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  294.     #define NewCMFlattenUPP(userRoutine)                             (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
  295.     #define NewCMBitmapCallBackUPP(userRoutine)                     (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
  296.     #define NewCMConcatCallBackUPP(userRoutine)                     (CMConcatCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMConcatCallBackProcInfo, GetCurrentArchitecture())
  297.     #define NewCMProfileFilterUPP(userRoutine)                         (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
  298.     #define NewCMProfileAccessUPP(userRoutine)                         (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
  299.     #define DisposeCMFlattenUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  300.     #define DisposeCMBitmapCallBackUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  301.     #define DisposeCMConcatCallBackUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  302.     #define DisposeCMProfileFilterUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  303.     #define DisposeCMProfileAccessUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  304.     #define InvokeCMFlattenUPP(command, size, data, refCon, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
  305.     #define InvokeCMBitmapCallBackUPP(progress, refCon, userUPP)     (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMBitmapCallBackProcInfo, (progress), (refCon))
  306.     #define InvokeCMConcatCallBackUPP(progress, refCon, userUPP)     (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMConcatCallBackProcInfo, (progress), (refCon))
  307.     #define InvokeCMProfileFilterUPP(prof, refCon, userUPP)         (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileFilterProcInfo, (prof), (refCon))
  308.     #define InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userUPP)  (OSErr)CALL_FIVE_PARAMETER_UPP((userUPP), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
  309. #endif
  310. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  311. #define NewCMFlattenProc(userRoutine)                             NewCMFlattenUPP(userRoutine)
  312. #define NewCMBitmapCallBackProc(userRoutine)                     NewCMBitmapCallBackUPP(userRoutine)
  313. #define NewCMConcatCallBackProc(userRoutine)                     NewCMConcatCallBackUPP(userRoutine)
  314. #define NewCMProfileFilterProc(userRoutine)                     NewCMProfileFilterUPP(userRoutine)
  315. #define NewCMProfileAccessProc(userRoutine)                     NewCMProfileAccessUPP(userRoutine)
  316. #define CallCMFlattenProc(userRoutine, command, size, data, refCon) InvokeCMFlattenUPP(command, size, data, refCon, userRoutine)
  317. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon)    InvokeCMBitmapCallBackUPP(progress, refCon, userRoutine)
  318. #define CallCMConcatCallBackProc(userRoutine, progress, refCon)    InvokeCMConcatCallBackUPP(progress, refCon, userRoutine)
  319. #define CallCMProfileFilterProc(userRoutine, prof, refCon)        InvokeCMProfileFilterUPP(prof, refCon, userRoutine)
  320. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon) InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userRoutine)
  321. typedef long                             CMError;
  322. /* For 1.0 and 2.0 profile header variants */
  323. /* CMAppleProfileHeader */
  324.  
  325. union CMAppleProfileHeader {
  326.     CMHeader                         cm1;
  327.     CM2Header                         cm2;
  328. };
  329. typedef union CMAppleProfileHeader        CMAppleProfileHeader;
  330. /* Param for CWConcatColorWorld(…) */
  331.  
  332. struct CMConcatProfileSet {
  333.     UInt16                             keyIndex;                    /* Zero-based */
  334.     UInt16                             count;                        /* Min 1 */
  335.     CMProfileRef                     profileSet[1];                /* Variable. Ordered from Source -> Dest */
  336. };
  337. typedef struct CMConcatProfileSet        CMConcatProfileSet;
  338.  
  339. /* NCMConcatProfileSpec Tags */
  340. enum {
  341.     kNoTransform                = 0,                            /* Not used */
  342.     kUseAtoB                    = 1,                            /* Use 'A2B*' tag from this profile or equivalent */
  343.     kUseBtoA                    = 2,                            /* Use 'B2A*' tag from this profile or equivalent */
  344.     kUseBtoB                    = 3,                            /* Use 'pre*' tag from this profile or equivalent */
  345.                                                                 /* For typical device profiles the following synonyms may be useful */
  346.     kDeviceToPCS                = kUseAtoB,                        /* Device Dependent to Device Independent */
  347.     kPCSToDevice                = kUseBtoA,                        /* Device Independent to Device Dependent */
  348.     kPCSToPCS                    = kUseBtoB,                        /* Independent, through device's gamut */
  349.     kUseProfileIntent            = (long)0xFFFFFFFF                /* For renderingIntent in NCMConcatProfileSpec    */
  350. };
  351.  
  352. /* NCMConcatProfileSpec */
  353.  
  354. struct NCMConcatProfileSpec {
  355.     UInt32                             renderingIntent;            /* renderingIntent override        */
  356.     UInt32                             transformTag;                /* transformTag, defined above    */
  357.     CMProfileRef                     profile;                    /* profile */
  358. };
  359. typedef struct NCMConcatProfileSpec        NCMConcatProfileSpec;
  360. /* NCMConcatProfileSet */
  361.  
  362. struct NCMConcatProfileSet {
  363.     OSType                             cmm;                        /* e.g. 'KCMS', 'appl', ...  uniquely ids the cmm, or 0000 */
  364.     UInt32                             flags;                        /* specify quality, lookup only, no gamut checking ... */
  365.     UInt32                             flagsMask;                    /* which bits of 'flags' to use to override profile */
  366.     UInt32                             profileCount;                /* how many ProfileSpecs in the following set */
  367.     NCMConcatProfileSpec             profileSpecs[1];            /* Variable. Ordered from Source -> Dest */
  368. };
  369. typedef struct NCMConcatProfileSet        NCMConcatProfileSet;
  370. /* ColorSync color data types */
  371.  
  372. struct CMRGBColor {
  373.     UInt16                             red;                        /* 0..65535 */
  374.     UInt16                             green;
  375.     UInt16                             blue;
  376. };
  377. typedef struct CMRGBColor                CMRGBColor;
  378.  
  379. struct CMCMYKColor {
  380.     UInt16                             cyan;                        /* 0..65535 */
  381.     UInt16                             magenta;
  382.     UInt16                             yellow;
  383.     UInt16                             black;
  384. };
  385. typedef struct CMCMYKColor                CMCMYKColor;
  386.  
  387. struct CMCMYColor {
  388.     UInt16                             cyan;                        /* 0..65535 */
  389.     UInt16                             magenta;
  390.     UInt16                             yellow;
  391. };
  392. typedef struct CMCMYColor                CMCMYColor;
  393.  
  394. struct CMHLSColor {
  395.     UInt16                             hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  396.     UInt16                             lightness;                    /* 0..65535 */
  397.     UInt16                             saturation;                    /* 0..65535 */
  398. };
  399. typedef struct CMHLSColor                CMHLSColor;
  400.  
  401. struct CMHSVColor {
  402.     UInt16                             hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  403.     UInt16                             saturation;                    /* 0..65535 */
  404.     UInt16                             value;                        /* 0..65535 */
  405. };
  406. typedef struct CMHSVColor                CMHSVColor;
  407.  
  408. struct CMLabColor {
  409.     UInt16                             L;                            /* 0..65535 maps to 0..100 */
  410.     UInt16                             a;                            /* 0..65535 maps to -128..127.996 */
  411.     UInt16                             b;                            /* 0..65535 maps to -128..127.996 */
  412. };
  413. typedef struct CMLabColor                CMLabColor;
  414.  
  415. struct CMLuvColor {
  416.     UInt16                             L;                            /* 0..65535 maps to 0..100 */
  417.     UInt16                             u;                            /* 0..65535 maps to -128..127.996 */
  418.     UInt16                             v;                            /* 0..65535 maps to -128..127.996 */
  419. };
  420. typedef struct CMLuvColor                CMLuvColor;
  421.  
  422. struct CMYxyColor {
  423.     UInt16                             capY;                        /* 0..65535 maps to 0..1 */
  424.     UInt16                             x;                            /* 0..65535 maps to 0..1 */
  425.     UInt16                             y;                            /* 0..65535 maps to 0..1 */
  426. };
  427. typedef struct CMYxyColor                CMYxyColor;
  428.  
  429. struct CMGrayColor {
  430.     UInt16                             gray;                        /* 0..65535 */
  431. };
  432. typedef struct CMGrayColor                CMGrayColor;
  433.  
  434. struct CMMultichannel5Color {
  435.     UInt8                             components[5];                /* 0..255 */
  436. };
  437. typedef struct CMMultichannel5Color        CMMultichannel5Color;
  438.  
  439. struct CMMultichannel6Color {
  440.     UInt8                             components[6];                /* 0..255 */
  441. };
  442. typedef struct CMMultichannel6Color        CMMultichannel6Color;
  443.  
  444. struct CMMultichannel7Color {
  445.     UInt8                             components[7];                /* 0..255 */
  446. };
  447. typedef struct CMMultichannel7Color        CMMultichannel7Color;
  448.  
  449. struct CMMultichannel8Color {
  450.     UInt8                             components[8];                /* 0..255 */
  451. };
  452. typedef struct CMMultichannel8Color        CMMultichannel8Color;
  453.  
  454. struct CMNamedColor {
  455.     UInt32                             namedColorIndex;            /* 0..a lot */
  456. };
  457. typedef struct CMNamedColor                CMNamedColor;
  458.  
  459. union CMColor {
  460.     CMRGBColor                         rgb;
  461.     CMHSVColor                         hsv;
  462.     CMHLSColor                         hls;
  463.     CMXYZColor                         XYZ;
  464.     CMLabColor                         Lab;
  465.     CMLuvColor                         Luv;
  466.     CMYxyColor                         Yxy;
  467.     CMCMYKColor                     cmyk;
  468.     CMCMYColor                         cmy;
  469.     CMGrayColor                     gray;
  470.     CMMultichannel5Color             mc5;
  471.     CMMultichannel6Color             mc6;
  472.     CMMultichannel7Color             mc7;
  473.     CMMultichannel8Color             mc8;
  474.     CMNamedColor                     namedColor;
  475. };
  476. typedef union CMColor                    CMColor;
  477.  
  478. struct CMProfileSearchRecord {
  479.     CMHeader                         header;
  480.     UInt32                             fieldMask;
  481.     UInt32                             reserved[2];
  482. };
  483. typedef struct CMProfileSearchRecord    CMProfileSearchRecord;
  484. typedef CMProfileSearchRecord *            CMProfileSearchRecordPtr;
  485. typedef CMProfileSearchRecordPtr *        CMProfileSearchRecordHandle;
  486. /* Search definition for 2.0 */
  487.  
  488. struct CMSearchRecord {
  489.     OSType                             CMMType;
  490.     OSType                             profileClass;
  491.     OSType                             dataColorSpace;
  492.     OSType                             profileConnectionSpace;
  493.     UInt32                             deviceManufacturer;
  494.     UInt32                             deviceModel;
  495.     UInt32                             deviceAttributes[2];
  496.     UInt32                             profileFlags;
  497.     UInt32                             searchMask;
  498.     CMProfileFilterUPP                 filter;
  499. };
  500. typedef struct CMSearchRecord            CMSearchRecord;
  501. /* CMMInfo structure */
  502.  
  503. struct CMMInfo {
  504.     UInt32                             dataSize;                    /* Size of this structure - compatibility*/
  505.     OSType                             CMMType;                    /* Signature, e.g. 'KCMS'*/
  506.     OSType                             CMMMfr;                        /* Vendor, e.g. 'appl'*/
  507.     UInt32                             CMMVersion;                    /* cmm version number*/
  508.     unsigned char                     ASCIIName[32];                /* pascal string - name*/
  509.     unsigned char                     ASCIIDesc[256];                /* pascal string - description or copyright*/
  510.     UniCharCount                     UniCodeNameCount;            /* count of UniChars in following array*/
  511.     UniChar                         UniCodeName[32];            /* the name in UniCode chars*/
  512.     UniCharCount                     UniCodeDescCount;            /* count of UniChars in following array*/
  513.     UniChar                         UniCodeDesc[256];            /* the description in UniCode chars*/
  514. };
  515. typedef struct CMMInfo                    CMMInfo;
  516. /* GetCWInfo structures */
  517.  
  518. struct CMMInfoRecord {
  519.     OSType                             CMMType;
  520.     long                             CMMVersion;
  521. };
  522. typedef struct CMMInfoRecord            CMMInfoRecord;
  523.  
  524. struct CMCWInfoRecord {
  525.     UInt32                             cmmCount;
  526.     CMMInfoRecord                     cmmInfo[2];
  527. };
  528. typedef struct CMCWInfoRecord            CMCWInfoRecord;
  529. /* profile identifier structures */
  530.  
  531. struct CMProfileIdentifier {
  532.     CM2Header                         profileHeader;
  533.     CMDateTime                         calibrationDate;
  534.     UInt32                             ASCIIProfileDescriptionLen;
  535.     char                             ASCIIProfileDescription[1];    /* variable length */
  536. };
  537. typedef struct CMProfileIdentifier        CMProfileIdentifier;
  538. typedef CMProfileIdentifier *            CMProfileIdentifierPtr;
  539. /* packing formats */
  540. enum {
  541.     cmNoColorPacking            = 0x0000,
  542.     cmWord5ColorPacking            = 0x0500,
  543.     cmWord565ColorPacking        = 0x0600,
  544.     cmLong8ColorPacking            = 0x0800,
  545.     cmLong10ColorPacking        = 0x0A00,
  546.     cmAlphaFirstPacking            = 0x1000,
  547.     cmOneBitDirectPacking        = 0x0B00,
  548.     cmAlphaLastPacking            = 0x0000,
  549.     cm8_8ColorPacking            = 0x2800,
  550.     cm16_8ColorPacking            = 0x2000,
  551.     cm24_8ColorPacking            = 0x2100,
  552.     cm32_8ColorPacking            = cmLong8ColorPacking,
  553.     cm40_8ColorPacking            = 0x2200,
  554.     cm48_8ColorPacking            = 0x2300,
  555.     cm56_8ColorPacking            = 0x2400,
  556.     cm64_8ColorPacking            = 0x2500,
  557.     cm32_16ColorPacking            = 0x2600,
  558.     cm48_16ColorPacking            = 0x2900,
  559.     cm64_16ColorPacking            = 0x2A00,
  560.     cm32_32ColorPacking            = 0x2700,
  561.     cmLittleEndianPacking        = 0x4000,
  562.     cmReverseChannelPacking        = 0x8000
  563. };
  564.  
  565. /* colorspace masks */
  566. enum {
  567.     cmColorSpaceSpaceMask        = 0x0000007F,
  568.     cmColorSpaceAlphaMask        = 0x00000080,
  569.     cmColorSpaceSpaceAndAlphaMask = 0x000000FF,
  570.     cmColorSpacePackingMask        = 0x0000FF00,
  571.     cmColorSpaceReservedMask    = (long)0xFFFF0000
  572. };
  573.  
  574. /* general colorspaces */
  575. enum {
  576.     cmNoSpace                    = 0,
  577.     cmRGBSpace                    = 1,
  578.     cmCMYKSpace                    = 2,
  579.     cmHSVSpace                    = 3,
  580.     cmHLSSpace                    = 4,
  581.     cmYXYSpace                    = 5,
  582.     cmXYZSpace                    = 6,
  583.     cmLUVSpace                    = 7,
  584.     cmLABSpace                    = 8,
  585.     cmReservedSpace1            = 9,
  586.     cmGraySpace                    = 10,
  587.     cmReservedSpace2            = 11,
  588.     cmGamutResultSpace            = 12,
  589.     cmNamedIndexedSpace            = 16,
  590.     cmMCFiveSpace                = 17,
  591.     cmMCSixSpace                = 18,
  592.     cmMCSevenSpace                = 19,
  593.     cmMCEightSpace                = 20,
  594.     cmAlphaSpace                = 0x80,
  595.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace,
  596.     cmGrayASpace                = cmGraySpace + cmAlphaSpace
  597. };
  598.  
  599. /* supported CMBitmapColorSpaces - Each of the following is a */
  600. /* combination of a general colospace and a packing formats. */
  601. /* Each can also be or'd with cmReverseChannelPacking. */
  602. enum {
  603.     cmGray8Space                = cmGraySpace + cm8_8ColorPacking,
  604.     cmGrayA16Space                = cmGrayASpace + cm16_8ColorPacking,
  605.     cmGray16Space                = cmGraySpace,
  606.     cmGrayA32Space                = cmGrayASpace,
  607.     cmGray16LSpace                = cmGraySpace + cmLittleEndianPacking,
  608.     cmGrayA32LSpace                = cmGrayASpace + cmLittleEndianPacking,
  609.     cmRGB16Space                = cmRGBSpace + cmWord5ColorPacking,
  610.     cmRGB16LSpace                = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
  611.     cmRGB565Space                = cmRGBSpace + cmWord565ColorPacking,
  612.     cmRGB565LSpace                = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
  613.     cmRGB24Space                = cmRGBSpace + cm24_8ColorPacking,
  614.     cmRGB32Space                = cmRGBSpace + cm32_8ColorPacking,
  615.     cmRGB48Space                = cmRGBSpace + cm48_16ColorPacking,
  616.     cmRGB48LSpace                = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  617.     cmARGB32Space                = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
  618.     cmARGB64Space                = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
  619.     cmARGB64LSpace                = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
  620.     cmRGBA32Space                = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
  621.     cmRGBA64Space                = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
  622.     cmRGBA64LSpace                = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
  623.     cmCMYK32Space                = cmCMYKSpace + cm32_8ColorPacking,
  624.     cmCMYK64Space                = cmCMYKSpace + cm64_16ColorPacking,
  625.     cmCMYK64LSpace                = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
  626.     cmHSV32Space                = cmHSVSpace + cmLong10ColorPacking,
  627.     cmHLS32Space                = cmHLSSpace + cmLong10ColorPacking,
  628.     cmYXY32Space                = cmYXYSpace + cmLong10ColorPacking,
  629.     cmXYZ24Space                = cmXYZSpace + cm24_8ColorPacking,
  630.     cmXYZ32Space                = cmXYZSpace + cmLong10ColorPacking,
  631.     cmXYZ48Space                = cmXYZSpace + cm48_16ColorPacking,
  632.     cmXYZ48LSpace                = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  633.     cmLUV32Space                = cmLUVSpace + cmLong10ColorPacking,
  634.     cmLAB24Space                = cmLABSpace + cm24_8ColorPacking,
  635.     cmLAB32Space                = cmLABSpace + cmLong10ColorPacking,
  636.     cmLAB48Space                = cmLABSpace + cm48_16ColorPacking,
  637.     cmLAB48LSpace                = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  638.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace,
  639.     cmNamedIndexed32Space        = cm32_32ColorPacking + cmNamedIndexedSpace,
  640.     cmNamedIndexed32LSpace        = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
  641.     cmMCFive8Space                = cm40_8ColorPacking + cmMCFiveSpace,
  642.     cmMCSix8Space                = cm48_8ColorPacking + cmMCSixSpace,
  643.     cmMCSeven8Space                = cm56_8ColorPacking + cmMCSevenSpace,
  644.     cmMCEight8Space                = cm64_8ColorPacking + cmMCEightSpace
  645. };
  646.  
  647.  
  648.  
  649. typedef UInt32                             CMBitmapColorSpace;
  650.  
  651. struct CMBitmap {
  652.     char *                            image;
  653.     long                             width;
  654.     long                             height;
  655.     long                             rowBytes;
  656.     long                             pixelSize;
  657.     CMBitmapColorSpace                 space;
  658.     long                             user1;
  659.     long                             user2;
  660. };
  661. typedef struct CMBitmap                    CMBitmap;
  662.  
  663. /* Classic Print Manager Stuff */
  664. #if TARGET_OS_MAC
  665. enum {
  666.     enableColorMatchingOp        = 12,
  667.     registerProfileOp            = 13
  668. };
  669.  
  670. #endif  /* TARGET_OS_MAC */
  671.  
  672. /* Profile Locations */
  673. enum {
  674.     CS_MAX_PATH                    = 256
  675. };
  676.  
  677. enum {
  678.     cmNoProfileBase                = 0,
  679.     cmFileBasedProfile            = 1,
  680.     cmHandleBasedProfile        = 2,
  681.     cmPtrBasedProfile            = 3,
  682.     cmProcedureBasedProfile        = 4,
  683.     cmPathBasedProfile            = 5,
  684.     cmBufferBasedProfile        = 6
  685. };
  686.  
  687.  
  688. struct CMFileLocation {
  689.     FSSpec                             spec;
  690. };
  691. typedef struct CMFileLocation            CMFileLocation;
  692.  
  693. struct CMHandleLocation {
  694.     Handle                             h;
  695. };
  696. typedef struct CMHandleLocation            CMHandleLocation;
  697.  
  698. struct CMPtrLocation {
  699.     Ptr                             p;
  700. };
  701. typedef struct CMPtrLocation            CMPtrLocation;
  702.  
  703. struct CMProcedureLocation {
  704.     CMProfileAccessUPP                 proc;
  705.     void *                            refCon;
  706. };
  707. typedef struct CMProcedureLocation        CMProcedureLocation;
  708.  
  709. struct CMPathLocation {
  710.     char                             path[256];
  711. };
  712. typedef struct CMPathLocation            CMPathLocation;
  713.  
  714. struct CMBufferLocation {
  715.     void *                            buffer;
  716.     UInt32                             size;
  717. };
  718. typedef struct CMBufferLocation            CMBufferLocation;
  719.  
  720. union CMProfLoc {
  721.     CMFileLocation                     fileLoc;
  722.     CMHandleLocation                 handleLoc;
  723.     CMPtrLocation                     ptrLoc;
  724.     CMProcedureLocation             procLoc;
  725.     CMPathLocation                     pathLoc;
  726.     CMBufferLocation                 bufferLoc;
  727. };
  728. typedef union CMProfLoc                    CMProfLoc;
  729.  
  730. struct CMProfileLocation {
  731.     short                             locType;
  732.     CMProfLoc                         u;
  733. };
  734. typedef struct CMProfileLocation        CMProfileLocation;
  735. #if TARGET_OS_MAC
  736. enum {
  737.     cmOriginalProfileLocationSize = 72,
  738.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  739. };
  740.  
  741. #else
  742. enum {
  743.     cmOriginalProfileLocationSize = 2 + CS_MAX_PATH,
  744.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  745. };
  746.  
  747. #endif  /* TARGET_OS_MAC */
  748.  
  749. /* Struct and enums used for Profile iteration */
  750. enum {
  751.     cmProfileIterateDataVersion1 = 0x00010000,
  752.     cmProfileIterateDataVersion2 = 0x00020000
  753. };
  754.  
  755.  
  756. struct CMProfileIterateData {
  757.     UInt32                             dataVersion;                /* cmProfileIterateDataVersion2 */
  758.     CM2Header                         header;
  759.     ScriptCode                         code;
  760.     Str255                             name;
  761.     CMProfileLocation                 location;
  762.     UniCharCount                     uniCodeNameCount;
  763.     UniChar *                        uniCodeName;
  764.     unsigned char *                    asciiName;
  765.     CMMakeAndModel *                makeAndModel;
  766. };
  767. typedef struct CMProfileIterateData        CMProfileIterateData;
  768. /* Caller-supplied callback function for Profile & CMM iteration */
  769. typedef CALLBACK_API( OSErr , CMProfileIterateProcPtr )(CMProfileIterateData *iterateData, void *refCon);
  770. typedef CALLBACK_API( OSErr , CMMIterateProcPtr )(CMMInfo *iterateData, void *refCon);
  771. typedef STACK_UPP_TYPE(CMProfileIterateProcPtr)                 CMProfileIterateUPP;
  772. typedef STACK_UPP_TYPE(CMMIterateProcPtr)                         CMMIterateUPP;
  773. #if OPAQUE_UPP_TYPES
  774.     EXTERN_API(CMProfileIterateUPP)
  775.     NewCMProfileIterateUPP           (CMProfileIterateProcPtr    userRoutine);
  776.  
  777.     EXTERN_API(CMMIterateUPP)
  778.     NewCMMIterateUPP               (CMMIterateProcPtr        userRoutine);
  779.  
  780.     EXTERN_API(void)
  781.     DisposeCMProfileIterateUPP       (CMProfileIterateUPP        userUPP);
  782.  
  783.     EXTERN_API(void)
  784.     DisposeCMMIterateUPP           (CMMIterateUPP            userUPP);
  785.  
  786.     EXTERN_API(OSErr)
  787.     InvokeCMProfileIterateUPP       (CMProfileIterateData *    iterateData,
  788.                                     void *                    refCon,
  789.                                     CMProfileIterateUPP        userUPP);
  790.  
  791.     EXTERN_API(OSErr)
  792.     InvokeCMMIterateUPP               (CMMInfo *                iterateData,
  793.                                     void *                    refCon,
  794.                                     CMMIterateUPP            userUPP);
  795.  
  796. #else
  797.     enum { uppCMProfileIterateProcInfo = 0x000003E0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  798.     enum { uppCMMIterateProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  799.     #define NewCMProfileIterateUPP(userRoutine)                     (CMProfileIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileIterateProcInfo, GetCurrentArchitecture())
  800.     #define NewCMMIterateUPP(userRoutine)                             (CMMIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture())
  801.     #define DisposeCMProfileIterateUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  802.     #define DisposeCMMIterateUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  803.     #define InvokeCMProfileIterateUPP(iterateData, refCon, userUPP)  (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileIterateProcInfo, (iterateData), (refCon))
  804.     #define InvokeCMMIterateUPP(iterateData, refCon, userUPP)         (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMMIterateProcInfo, (iterateData), (refCon))
  805. #endif
  806. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  807. #define NewCMProfileIterateProc(userRoutine)                     NewCMProfileIterateUPP(userRoutine)
  808. #define NewCMMIterateProc(userRoutine)                             NewCMMIterateUPP(userRoutine)
  809. #define CallCMProfileIterateProc(userRoutine, iterateData, refCon) InvokeCMProfileIterateUPP(iterateData, refCon, userRoutine)
  810. #define CallCMMIterateProc(userRoutine, iterateData, refCon)    InvokeCMMIterateUPP(iterateData, refCon, userRoutine)
  811. /* Profile file and element access */
  812. EXTERN_API( CMError )
  813. CMNewProfile                    (CMProfileRef *            prof,
  814.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  815.  
  816. EXTERN_API( CMError )
  817. CMOpenProfile                    (CMProfileRef *            prof,
  818.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  819.  
  820. EXTERN_API( CMError )
  821. CMCloseProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  822.  
  823. EXTERN_API( CMError )
  824. CMUpdateProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  825.  
  826. EXTERN_API( CMError )
  827. CMCopyProfile                    (CMProfileRef *            targetProf,
  828.                                  const CMProfileLocation * targetLocation,
  829.                                  CMProfileRef             srcProf)                            FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  830.  
  831. EXTERN_API( CMError )
  832. CMValidateProfile                (CMProfileRef             prof,
  833.                                  Boolean *                valid,
  834.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  835.  
  836. EXTERN_API( CMError )
  837. CMGetProfileLocation            (CMProfileRef             prof,
  838.                                  CMProfileLocation *    theProfile)                            FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  839.  
  840. EXTERN_API( CMError )
  841. NCMGetProfileLocation            (CMProfileRef             prof,
  842.                                  CMProfileLocation *    theProfile,
  843.                                  UInt32 *                locationSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0059, 0xABEE);
  844.  
  845. EXTERN_API( CMError )
  846. CMFlattenProfile                (CMProfileRef             prof,
  847.                                  UInt32                 flags,
  848.                                  CMFlattenUPP             proc,
  849.                                  void *                    refCon,
  850.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  851.  
  852. #if TARGET_OS_MAC
  853. EXTERN_API( CMError )
  854. CMUnflattenProfile                (FSSpec *                resultFileSpec,
  855.                                  CMFlattenUPP             proc,
  856.                                  void *                    refCon,
  857.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  858.  
  859. #endif  /* TARGET_OS_MAC */
  860.  
  861. EXTERN_API( CMError )
  862. CMGetProfileHeader                (CMProfileRef             prof,
  863.                                  CMAppleProfileHeader *    header)                                FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  864.  
  865. EXTERN_API( CMError )
  866. CMSetProfileHeader                (CMProfileRef             prof,
  867.                                  const CMAppleProfileHeader * header)                        FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  868.  
  869. EXTERN_API( CMError )
  870. CMProfileElementExists            (CMProfileRef             prof,
  871.                                  OSType                 tag,
  872.                                  Boolean *                found)                                FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  873.  
  874. EXTERN_API( CMError )
  875. CMCountProfileElements            (CMProfileRef             prof,
  876.                                  UInt32 *                elementCount)                        FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  877.  
  878. EXTERN_API( CMError )
  879. CMGetProfileElement                (CMProfileRef             prof,
  880.                                  OSType                 tag,
  881.                                  UInt32 *                elementSize,
  882.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  883.  
  884. EXTERN_API( CMError )
  885. CMSetProfileElement                (CMProfileRef             prof,
  886.                                  OSType                 tag,
  887.                                  UInt32                 elementSize,
  888.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  889.  
  890. EXTERN_API( CMError )
  891. CMSetProfileElementSize            (CMProfileRef             prof,
  892.                                  OSType                 tag,
  893.                                  UInt32                 elementSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  894.  
  895. EXTERN_API( CMError )
  896. CMSetProfileElementReference    (CMProfileRef             prof,
  897.                                  OSType                 elementTag,
  898.                                  OSType                 referenceTag)                        FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  899.  
  900. EXTERN_API( CMError )
  901. CMGetPartialProfileElement        (CMProfileRef             prof,
  902.                                  OSType                 tag,
  903.                                  UInt32                 offset,
  904.                                  UInt32 *                byteCount,
  905.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  906.  
  907. EXTERN_API( CMError )
  908. CMSetPartialProfileElement        (CMProfileRef             prof,
  909.                                  OSType                 tag,
  910.                                  UInt32                 offset,
  911.                                  UInt32                 byteCount,
  912.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  913.  
  914. EXTERN_API( CMError )
  915. CMGetIndProfileElementInfo        (CMProfileRef             prof,
  916.                                  UInt32                 index,
  917.                                  OSType *                tag,
  918.                                  UInt32 *                elementSize,
  919.                                  Boolean *                refs)                                FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  920.  
  921. EXTERN_API( CMError )
  922. CMGetIndProfileElement            (CMProfileRef             prof,
  923.                                  UInt32                 index,
  924.                                  UInt32 *                elementSize,
  925.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  926.  
  927. EXTERN_API( CMError )
  928. CMRemoveProfileElement            (CMProfileRef             prof,
  929.                                  OSType                 tag)                                FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  930.  
  931. EXTERN_API( CMError )
  932. CMGetScriptProfileDescription    (CMProfileRef             prof,
  933.                                  Str255                 name,
  934.                                  ScriptCode *            code)                                FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  935.  
  936. EXTERN_API( CMError )
  937. CMGetProfileDescriptions        (CMProfileRef             prof,
  938.                                  char *                    aName,
  939.                                  UInt32 *                aCount,
  940.                                  Str255                 mName,
  941.                                  ScriptCode *            mCode,
  942.                                  UniChar *                uName,
  943.                                  UniCharCount *            uCount)                                FOURWORDINLINE(0x203C, 0x001A, 0x0067, 0xABEE);
  944.  
  945. EXTERN_API( CMError )
  946. CMSetProfileDescriptions        (CMProfileRef             prof,
  947.                                  const char *            aName,
  948.                                  UInt32                 aCount,
  949.                                  ConstStr255Param         mName,
  950.                                  ScriptCode             mCode,
  951.                                  const UniChar *        uName,
  952.                                  UniCharCount             uCount)                                FOURWORDINLINE(0x203C, 0x001A, 0x0068, 0xABEE);
  953.  
  954. EXTERN_API( CMError )
  955. CMCloneProfileRef                (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  956.  
  957. EXTERN_API( CMError )
  958. CMGetProfileRefCount            (CMProfileRef             prof,
  959.                                  long *                    count)                                FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  960.  
  961. EXTERN_API( CMError )
  962. CMProfileModified                (CMProfileRef             prof,
  963.                                  Boolean *                modified)                            FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  964.  
  965.  
  966. /* named Color access functions */
  967. EXTERN_API( CMError )
  968. CMGetNamedColorInfo                (CMProfileRef             prof,
  969.                                  UInt32 *                deviceChannels,
  970.                                  OSType *                deviceColorSpace,
  971.                                  OSType *                PCSColorSpace,
  972.                                  UInt32 *                count,
  973.                                  StringPtr                 prefix,
  974.                                  StringPtr                 suffix)                                FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  975.  
  976. EXTERN_API( CMError )
  977. CMGetNamedColorValue            (CMProfileRef             prof,
  978.                                  StringPtr                 name,
  979.                                  CMColor *                deviceColor,
  980.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  981.  
  982. EXTERN_API( CMError )
  983. CMGetIndNamedColorValue            (CMProfileRef             prof,
  984.                                  UInt32                 index,
  985.                                  CMColor *                deviceColor,
  986.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  987.  
  988. EXTERN_API( CMError )
  989. CMGetNamedColorIndex            (CMProfileRef             prof,
  990.                                  StringPtr                 name,
  991.                                  UInt32 *                index)                                FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  992.  
  993. EXTERN_API( CMError )
  994. CMGetNamedColorName                (CMProfileRef             prof,
  995.                                  UInt32                 index,
  996.                                  StringPtr                 name)                                FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  997.  
  998.  
  999. /* General-purpose matching functions */
  1000. EXTERN_API( CMError )
  1001. NCWNewColorWorld                (CMWorldRef *            cw,
  1002.                                  CMProfileRef             src,
  1003.                                  CMProfileRef             dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  1004.  
  1005. EXTERN_API( CMError )
  1006. CWConcatColorWorld                (CMWorldRef *            cw,
  1007.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  1008.  
  1009. EXTERN_API( CMError )
  1010. CWNewLinkProfile                (CMProfileRef *            prof,
  1011.                                  const CMProfileLocation * targetLocation,
  1012.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  1013.  
  1014. EXTERN_API( CMError )
  1015. NCWConcatColorWorld                (CMWorldRef *            cw,
  1016.                                  NCMConcatProfileSet *    profileSet,
  1017.                                  CMConcatCallBackUPP     proc,
  1018.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0008, 0x0061, 0xABEE);
  1019.  
  1020. EXTERN_API( CMError )
  1021. NCWNewLinkProfile                (CMProfileRef *            prof,
  1022.                                  const CMProfileLocation * targetLocation,
  1023.                                  NCMConcatProfileSet *    profileSet,
  1024.                                  CMConcatCallBackUPP     proc,
  1025.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x000C, 0x0062, 0xABEE);
  1026.  
  1027. EXTERN_API( void )
  1028. CWDisposeColorWorld                (CMWorldRef             cw)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  1029.  
  1030. EXTERN_API( CMError )
  1031. CWMatchColors                    (CMWorldRef             cw,
  1032.                                  CMColor *                myColors,
  1033.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  1034.  
  1035. EXTERN_API( CMError )
  1036. CWCheckColors                    (CMWorldRef             cw,
  1037.                                  CMColor *                myColors,
  1038.                                  UInt32                 count,
  1039.                                  UInt32 *                result)                                FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  1040.  
  1041. EXTERN_API( CMError )
  1042. CWMatchBitmap                    (CMWorldRef             cw,
  1043.                                  CMBitmap *                bitmap,
  1044.                                  CMBitmapCallBackUPP     progressProc,
  1045.                                  void *                    refCon,
  1046.                                  CMBitmap *                matchedBitmap)                        FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  1047.  
  1048. EXTERN_API( CMError )
  1049. CWCheckBitmap                    (CMWorldRef             cw,
  1050.                                  const CMBitmap *        bitmap,
  1051.                                  CMBitmapCallBackUPP     progressProc,
  1052.                                  void *                    refCon,
  1053.                                  CMBitmap *                resultBitmap)                        FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  1054.  
  1055.  
  1056. /* Quickdraw-specific matching */
  1057. EXTERN_API( CMError )
  1058. CWMatchPixMap                    (CMWorldRef             cw,
  1059.                                  PixMap *                myPixMap,
  1060.                                  CMBitmapCallBackUPP     progressProc,
  1061.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  1062.  
  1063. EXTERN_API( CMError )
  1064. CWCheckPixMap                    (CMWorldRef             cw,
  1065.                                  PixMap *                myPixMap,
  1066.                                  CMBitmapCallBackUPP     progressProc,
  1067.                                  void *                    refCon,
  1068.                                  BitMap *                resultBitMap)                        FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  1069.  
  1070. #if TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON
  1071. EXTERN_API( CMError )
  1072. NCMBeginMatching                (CMProfileRef             src,
  1073.                                  CMProfileRef             dst,
  1074.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  1075.  
  1076. EXTERN_API( void )
  1077. CMEndMatching                    (CMMatchRef             myRef)                                FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  1078.  
  1079. EXTERN_API( void )
  1080. NCMDrawMatchedPicture            (PicHandle                 myPicture,
  1081.                                  CMProfileRef             dst,
  1082.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  1083.  
  1084. EXTERN_API( void )
  1085. CMEnableMatchingComment            (Boolean                 enableIt)                            FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  1086.  
  1087. EXTERN_API( CMError )
  1088. NCMUseProfileComment            (CMProfileRef             prof,
  1089.                                  UInt32                 flags)                                FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  1090.  
  1091. #endif  /* TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON */
  1092.  
  1093. #if TARGET_OS_WIN32
  1094. EXTERN_API( CMError )
  1095. CWMatchHBITMAP                    (CMWorldRef             cw,
  1096.                                  HBITMAP                 hBitmap,
  1097.                                  CMBitmapCallBackUPP     progressProc,
  1098.                                  void *                    refCon);
  1099.  
  1100. #endif  /* TARGET_OS_WIN32 */
  1101.  
  1102. EXTERN_API( CMError )
  1103. CMCreateProfileIdentifier        (CMProfileRef             prof,
  1104.                                  CMProfileIdentifierPtr  ident,
  1105.                                  UInt32 *                size)                                FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  1106.  
  1107.  
  1108. /* System Profile access */
  1109. EXTERN_API( CMError )
  1110. CMGetSystemProfile                (CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  1111.  
  1112. EXTERN_API( CMError )
  1113. CMSetSystemProfile                (const FSSpec *            profileFileSpec)                    FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  1114.  
  1115. EXTERN_API( CMError )
  1116. NCMSetSystemProfile                (const CMProfileLocation * profLoc)                            FOURWORDINLINE(0x203C, 0x0004, 0x0064, 0xABEE);
  1117.  
  1118. EXTERN_API( CMError )
  1119. CMGetDefaultProfileBySpace        (OSType                 dataColorSpace,
  1120.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005A, 0xABEE);
  1121.  
  1122. EXTERN_API( CMError )
  1123. CMSetDefaultProfileBySpace        (OSType                 dataColorSpace,
  1124.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005B, 0xABEE);
  1125.  
  1126. #if TARGET_OS_MAC
  1127. EXTERN_API( CMError )
  1128. CMGetProfileByAVID                (AVIDType                 theAVID,
  1129.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005C, 0xABEE);
  1130.  
  1131. EXTERN_API( CMError )
  1132. CMSetProfileByAVID                (AVIDType                 theAVID,
  1133.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005D, 0xABEE);
  1134.  
  1135. #endif  /* TARGET_OS_MAC */
  1136.  
  1137. /* Profile Use enumerations */
  1138. enum {
  1139.     cmInputUse                    = FOUR_CHAR_CODE('inpt'),
  1140.     cmOutputUse                    = FOUR_CHAR_CODE('outp'),
  1141.     cmDisplayUse                = FOUR_CHAR_CODE('dply'),
  1142.     cmProofUse                    = FOUR_CHAR_CODE('pruf')
  1143. };
  1144.  
  1145. /* Profile access by Use */
  1146. EXTERN_API( CMError )
  1147. CMGetDefaultProfileByUse        (OSType                 use,
  1148.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x0069, 0xABEE);
  1149.  
  1150. EXTERN_API( CMError )
  1151. CMSetDefaultProfileByUse        (OSType                 use,
  1152.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x0079, 0xABEE);
  1153.  
  1154. /* Profile Management */
  1155. EXTERN_API( CMError )
  1156. CMNewProfileSearch                (CMSearchRecord *        searchSpec,
  1157.                                  void *                    refCon,
  1158.                                  UInt32 *                count,
  1159.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  1160.  
  1161. EXTERN_API( CMError )
  1162. CMUpdateProfileSearch            (CMProfileSearchRef     search,
  1163.                                  void *                    refCon,
  1164.                                  UInt32 *                count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  1165.  
  1166. EXTERN_API( void )
  1167. CMDisposeProfileSearch            (CMProfileSearchRef     search)                                FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  1168.  
  1169. EXTERN_API( CMError )
  1170. CMSearchGetIndProfile            (CMProfileSearchRef     search,
  1171.                                  UInt32                 index,
  1172.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  1173.  
  1174. EXTERN_API( CMError )
  1175. CMSearchGetIndProfileFileSpec    (CMProfileSearchRef     search,
  1176.                                  UInt32                 index,
  1177.                                  FSSpec *                profileFile)                        FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  1178.  
  1179. EXTERN_API( CMError )
  1180. CMProfileIdentifierFolderSearch    (CMProfileIdentifierPtr  ident,
  1181.                                  UInt32 *                matchedCount,
  1182.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  1183.  
  1184. EXTERN_API( CMError )
  1185. CMProfileIdentifierListSearch    (CMProfileIdentifierPtr  ident,
  1186.                                  CMProfileRef *            profileList,
  1187.                                  UInt32                 listSize,
  1188.                                  UInt32 *                matchedCount,
  1189.                                  CMProfileRef *            matchedList)                        FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  1190.  
  1191. EXTERN_API( CMError )
  1192. CMIterateColorSyncFolder        (CMProfileIterateUPP     proc,
  1193.                                  UInt32 *                seed,
  1194.                                  UInt32 *                count,
  1195.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0058, 0xABEE);
  1196.  
  1197. EXTERN_API( CMError )
  1198. NCMUnflattenProfile                (CMProfileLocation *    targetLocation,
  1199.                                  CMFlattenUPP             proc,
  1200.                                  void *                    refCon,
  1201.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0065, 0xABEE);
  1202.  
  1203. /* Utilities */
  1204. #if TARGET_OS_MAC
  1205. EXTERN_API( CMError )
  1206. CMGetColorSyncFolderSpec        (short                     vRefNum,
  1207.                                  Boolean                 createFolder,
  1208.                                  short *                foundVRefNum,
  1209.                                  long *                    foundDirID)                            FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  1210.  
  1211. #endif  /* TARGET_OS_MAC */
  1212.  
  1213. #if TARGET_OS_WIN32 || TARGET_OS_UNIX
  1214. EXTERN_API( CMError )
  1215. CMGetColorSyncFolderPath        (Boolean                 createFolder,
  1216.                                  char *                    lpBuffer,
  1217.                                  UInt32                 uSize);
  1218.  
  1219. #endif  /* TARGET_OS_WIN32 || TARGET_OS_UNIX */
  1220.  
  1221. EXTERN_API( CMError )
  1222. CMGetCWInfo                        (CMWorldRef             cw,
  1223.                                  CMCWInfoRecord *        info)                                FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  1224.  
  1225. #if TARGET_API_MAC_OS8
  1226. EXTERN_API( CMError )
  1227. CMConvertProfile2to1            (CMProfileRef             profv2,
  1228.                                  CMProfileHandle *        profv1)                                FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  1229.  
  1230. #endif  /* TARGET_API_MAC_OS8 */
  1231.  
  1232. EXTERN_API( CMError )
  1233. CMGetPreferredCMM                (OSType *                cmmType,
  1234.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0008, 0x005E, 0xABEE);
  1235.  
  1236. EXTERN_API( CMError )
  1237. CMIterateCMMInfo                (CMMIterateUPP             proc,
  1238.                                  UInt32 *                count,
  1239.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x000C, 0x0063, 0xABEE);
  1240.  
  1241. EXTERN_API( CMError )
  1242. CMGetColorSyncVersion            (UInt32 *                version)                            FOURWORDINLINE(0x203C, 0x0004, 0x0066, 0xABEE);
  1243.  
  1244. EXTERN_API( CMError )
  1245. CMLaunchControlPanel            (UInt32                 flags);
  1246.  
  1247. /* ColorSpace conversion functions */
  1248. EXTERN_API( CMError )
  1249. CMConvertXYZToLab                (const CMColor *        src,
  1250.                                  const CMXYZColor *        white,
  1251.                                  CMColor *                dst,
  1252.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  1253.  
  1254. EXTERN_API( CMError )
  1255. CMConvertLabToXYZ                (const CMColor *        src,
  1256.                                  const CMXYZColor *        white,
  1257.                                  CMColor *                dst,
  1258.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  1259.  
  1260. EXTERN_API( CMError )
  1261. CMConvertXYZToLuv                (const CMColor *        src,
  1262.                                  const CMXYZColor *        white,
  1263.                                  CMColor *                dst,
  1264.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  1265.  
  1266. EXTERN_API( CMError )
  1267. CMConvertLuvToXYZ                (const CMColor *        src,
  1268.                                  const CMXYZColor *        white,
  1269.                                  CMColor *                dst,
  1270.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  1271.  
  1272. EXTERN_API( CMError )
  1273. CMConvertXYZToYxy                (const CMColor *        src,
  1274.                                  CMColor *                dst,
  1275.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  1276.  
  1277. EXTERN_API( CMError )
  1278. CMConvertYxyToXYZ                (const CMColor *        src,
  1279.                                  CMColor *                dst,
  1280.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  1281.  
  1282. EXTERN_API( CMError )
  1283. CMConvertRGBToHLS                (const CMColor *        src,
  1284.                                  CMColor *                dst,
  1285.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  1286.  
  1287. EXTERN_API( CMError )
  1288. CMConvertHLSToRGB                (const CMColor *        src,
  1289.                                  CMColor *                dst,
  1290.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  1291.  
  1292. EXTERN_API( CMError )
  1293. CMConvertRGBToHSV                (const CMColor *        src,
  1294.                                  CMColor *                dst,
  1295.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  1296.  
  1297. EXTERN_API( CMError )
  1298. CMConvertHSVToRGB                (const CMColor *        src,
  1299.                                  CMColor *                dst,
  1300.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  1301.  
  1302. EXTERN_API( CMError )
  1303. CMConvertRGBToGray                (const CMColor *        src,
  1304.                                  CMColor *                dst,
  1305.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  1306.  
  1307. EXTERN_API( CMError )
  1308. CMConvertXYZToFixedXYZ            (const CMXYZColor *        src,
  1309.                                  CMFixedXYZColor *        dst,
  1310.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  1311.  
  1312. EXTERN_API( CMError )
  1313. CMConvertFixedXYZToXYZ            (const CMFixedXYZColor * src,
  1314.                                  CMXYZColor *            dst,
  1315.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  1316.  
  1317.  
  1318. /* PS-related */
  1319. EXTERN_API( CMError )
  1320. CMGetPS2ColorSpace                (CMProfileRef             srcProf,
  1321.                                  UInt32                 flags,
  1322.                                  CMFlattenUPP             proc,
  1323.                                  void *                    refCon,
  1324.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  1325.  
  1326. EXTERN_API( CMError )
  1327. CMGetPS2ColorRenderingIntent    (CMProfileRef             srcProf,
  1328.                                  UInt32                 flags,
  1329.                                  CMFlattenUPP             proc,
  1330.                                  void *                    refCon,
  1331.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  1332.  
  1333. EXTERN_API( CMError )
  1334. CMGetPS2ColorRendering            (CMProfileRef             srcProf,
  1335.                                  CMProfileRef             dstProf,
  1336.                                  UInt32                 flags,
  1337.                                  CMFlattenUPP             proc,
  1338.                                  void *                    refCon,
  1339.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  1340.  
  1341. EXTERN_API( CMError )
  1342. CMGetPS2ColorRenderingVMSize    (CMProfileRef             srcProf,
  1343.                                  CMProfileRef             dstProf,
  1344.                                  UInt32 *                vmSize,
  1345.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  1346.  
  1347.  
  1348. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  1349. #if TARGET_API_MAC_OS8
  1350. EXTERN_API( CMError )
  1351. CWNewColorWorld                    (CMWorldRef *            cw,
  1352.                                  CMProfileHandle         src,
  1353.                                  CMProfileHandle         dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  1354.  
  1355. EXTERN_API( CMError )
  1356. ConcatenateProfiles                (CMProfileHandle         thru,
  1357.                                  CMProfileHandle         dst,
  1358.                                  CMProfileHandle *        newDst)                                FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  1359.  
  1360. EXTERN_API( CMError )
  1361. CMBeginMatching                    (CMProfileHandle         src,
  1362.                                  CMProfileHandle         dst,
  1363.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  1364.  
  1365. EXTERN_API( void )
  1366. CMDrawMatchedPicture            (PicHandle                 myPicture,
  1367.                                  CMProfileHandle         dst,
  1368.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  1369.  
  1370. EXTERN_API( CMError )
  1371. CMUseProfileComment                (CMProfileHandle         profile)                            FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  1372.  
  1373. EXTERN_API( void )
  1374. CMGetProfileName                (CMProfileHandle         myProfile,
  1375.                                  CMIString *            IStringResult)                        FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  1376.  
  1377. EXTERN_API( long )
  1378. CMGetProfileAdditionalDataOffset (CMProfileHandle         myProfile)                            FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  1379.  
  1380.  
  1381. /* ProfileResponder functions */
  1382. EXTERN_API( CMError )
  1383. GetProfile                        (OSType                 deviceType,
  1384.                                  long                     refNum,
  1385.                                  CMProfileHandle         aProfile,
  1386.                                  CMProfileHandle *        returnedProfile)                    FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  1387.  
  1388. EXTERN_API( CMError )
  1389. SetProfile                        (OSType                 deviceType,
  1390.                                  long                     refNum,
  1391.                                  CMProfileHandle         newProfile)                            FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  1392.  
  1393. EXTERN_API( CMError )
  1394. SetProfileDescription            (OSType                 deviceType,
  1395.                                  long                     refNum,
  1396.                                  long                     deviceData,
  1397.                                  CMProfileHandle         hProfile)                            FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  1398.  
  1399. EXTERN_API( CMError )
  1400. GetIndexedProfile                (OSType                 deviceType,
  1401.                                  long                     refNum,
  1402.                                  CMProfileSearchRecordHandle  search,
  1403.                                  CMProfileHandle *        returnProfile,
  1404.                                  long *                    index)                                FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  1405.  
  1406. EXTERN_API( CMError )
  1407. DeleteDeviceProfile                (OSType                 deviceType,
  1408.                                  long                     refNum,
  1409.                                  CMProfileHandle         deleteMe)                            FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  1410.  
  1411.  
  1412. #if OLDROUTINENAMES
  1413. /* constants */
  1414.  
  1415. typedef CMFlattenProcPtr                 CMFlattenProc;
  1416. typedef CMBitmapCallBackProcPtr         CMBitmapCallBackProc;
  1417. typedef CMProfileFilterProcPtr             CMProfileFilterProc;
  1418. enum {
  1419.     CMTrap                        = cmTrap,
  1420.     CMBeginProfile                = cmBeginProfile,
  1421.     CMEndProfile                = cmEndProfile,
  1422.     CMEnableMatching            = cmEnableMatching,
  1423.     CMDisableMatching            = cmDisableMatching
  1424. };
  1425.  
  1426. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  1427. enum {
  1428.     CMNoError                    = 0,                            /*    obsolete name, use noErr */
  1429.     CMProfileError                = cmProfileError,
  1430.     CMMethodError                = cmMethodError,
  1431.     CMMemFullError                = -172,                            /*    obsolete, 2.0 uses memFullErr */
  1432.     CMUnimplementedError        = -173,                            /*    obsolete, 2.0 uses unimpErr */
  1433.     CMParamError                = -174,                            /*    obsolete, 2.0 uses paramErr */
  1434.     CMMethodNotFound            = cmMethodNotFound,
  1435.     CMProfileNotFound            = cmProfileNotFound,
  1436.     CMProfilesIdentical            = cmProfilesIdentical,
  1437.     CMCantConcatenateError        = cmCantConcatenateError,
  1438.     CMCantXYZ                    = cmCantXYZ,
  1439.     CMCantDeleteProfile            = cmCantDeleteProfile,
  1440.     CMUnsupportedDataType        = cmUnsupportedDataType,
  1441.     CMNoCurrentProfile            = cmNoCurrentProfile
  1442. };
  1443.  
  1444. enum {
  1445.     qdSystemDevice                = cmSystemDevice,
  1446.     qdGDevice                    = cmGDevice
  1447. };
  1448.  
  1449.  
  1450. enum {
  1451.     kMatchCMMType                = cmMatchCMMType,
  1452.     kMatchApplProfileVersion    = cmMatchApplProfileVersion,
  1453.     kMatchDataType                = cmMatchDataType,
  1454.     kMatchDeviceType            = cmMatchDeviceType,
  1455.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer,
  1456.     kMatchDeviceModel            = cmMatchDeviceModel,
  1457.     kMatchDeviceAttributes        = cmMatchDeviceAttributes,
  1458.     kMatchFlags                    = cmMatchFlags,
  1459.     kMatchOptions                = cmMatchOptions,
  1460.     kMatchWhite                    = cmMatchWhite,
  1461.     kMatchBlack                    = cmMatchBlack
  1462. };
  1463.  
  1464. /* types */
  1465. typedef CMCMYKColor                     CMYKColor;
  1466. typedef CMWorldRef                         CWorld;
  1467. typedef long *                            CMGamutResult;
  1468. /* functions */
  1469. #define EndMatching(myRef)                                                        CMEndMatching(myRef)
  1470. #define EnableMatching(enableIt)                                                CMEnableMatchingComment(enableIt)
  1471. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)    CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  1472. #define BeginMatching(src, dst, myRef)                                            CMBeginMatching(src, dst, myRef)
  1473. #define DrawMatchedPicture(myPicture, dst, myRect)                                CMDrawMatchedPicture(myPicture, dst, myRect)
  1474. #define UseProfile(profile)                                                        CMUseProfileComment(profile)
  1475. #define GetProfileName(myProfile, IStringResult)                                CMGetProfileName(myProfile, IStringResult)
  1476. #define GetProfileAdditionalDataOffset(myProfile)                                CMGetProfileAdditionalDataOffset(myProfile)
  1477. #endif  /* OLDROUTINENAMES */
  1478.  
  1479. /* Deprecated stuff*/
  1480.  
  1481. /* PrGeneral parameter blocks */
  1482.  
  1483. struct TEnableColorMatchingBlk {
  1484.     short                             iOpCode;
  1485.     short                             iError;
  1486.     long                             lReserved;
  1487.     THPrint                         hPrint;
  1488.     Boolean                         fEnableIt;
  1489.     SInt8                             filler;
  1490. };
  1491. typedef struct TEnableColorMatchingBlk    TEnableColorMatchingBlk;
  1492.  
  1493. struct TRegisterProfileBlk {
  1494.     short                             iOpCode;
  1495.     short                             iError;
  1496.     long                             lReserved;
  1497.     THPrint                         hPrint;
  1498.     Boolean                         fRegisterIt;
  1499.     SInt8                             filler;
  1500. };
  1501. typedef struct TRegisterProfileBlk        TRegisterProfileBlk;
  1502. #endif  /* TARGET_API_MAC_OS8 */
  1503.  
  1504.  
  1505. #if PRAGMA_STRUCT_ALIGN
  1506.     #pragma options align=reset
  1507. #elif PRAGMA_STRUCT_PACKPUSH
  1508.     #pragma pack(pop)
  1509. #elif PRAGMA_STRUCT_PACK
  1510.     #pragma pack()
  1511. #endif
  1512.  
  1513. #ifdef PRAGMA_IMPORT_OFF
  1514. #pragma import off
  1515. #elif PRAGMA_IMPORT
  1516. #pragma import reset
  1517. #endif
  1518.  
  1519. #ifdef __cplusplus
  1520. }
  1521. #endif
  1522.  
  1523. #endif /* __CMAPPLICATION__ */
  1524.  
  1525.